package com.hww.service;


import com.hww.annotation.Component;
import com.hww.bean.InitializingBean;
import com.hww.annotation.PostConstruct;
import com.hww.annotation.PreDestroy;

/**
 * @author: heweiwei
 * @time: 2025/4/28 20:30
 * @description:
 */

@Component
public class UserService implements UserInterface, InitializingBean {
    @Override
    public void sayHello() {
        System.out.println("Hello from UserService!");
    }

    @PostConstruct
    public void init() {
        System.out.println("UserService: @PostConstruct method called");
    }

    @PreDestroy
    public void destroy() {
        System.out.println("UserService: @PreDestroy method called");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("UserService: afterPropertiesSet method called");
    }
}